package cn.itsource.zcn.org.mapper;

import cn.itsource.zcn.org.domain.ShopLog;
import org.apache.ibatis.annotations.*;

import java.util.List;

/**
 * (ShopLog)表数据库访问层
 *
 * @author makejava
 * @since 2021-08-17 17:14:09
 */
public interface ShoplogMapper {

    /**
     * 新增数据
     *
     * @param tShoplog 实例对象
     */
    @Insert("insert into t_shoplog" +
            "(admin_id,shop_id,createDate,reason)" +
            "values (#{admin_id},#{shop_id},#{createDate},#{reason})")
    void save(ShopLog tShoplog);

    /**
     * 修改数据
     *
     * @param tShoplog 实例对象
     */
    @Update("update t_shoplog set " +
            "admin_id=#{admin_id},shop_id=#{shop_id},createDate=#{createDate},reason=#{reason} " +
            "where id = #{id}")
    void update(ShopLog tShoplog);

    /**
     * 通过主键删除数据
     *
     * @param id 主键
     */
    @Delete("delete from t_shoplog where id = #{id} ")
    void delete(Integer id);


    /**
     * 通过ID查询单条数据
     *
     * @param id 主键
     * @return 实例对象
     */
    @Select("select * from t_shoplog where id = #{id}")
    ShopLog queryById(Integer id);

    /**
     * 查询全部
     *
     * @return 对象列表
     */
    @Select("select * from t_shoplog")
    List<ShopLog> queryAll();

    /**
     * 批量新增数据（MyBatis原生foreach方法）
     *
     * @param entities List<ShopLog> 实例对象列表
     */
    void insertBatch(@Param("ShopLogs") List<ShopLog> entities);

    /**
     * 批量删除数据（MyBatis原生foreach方法）
     *
     * @param ids List<Integer> 实例对象列表
     */
    void deleteBatch(@Param("ids") List<Integer> ids);


}

